#ifndef __MODBUS_H__
#define __MODBUS_H__

#include "stm32f1xx_hal.h"

#define MODBUS_RX_BUF_SIZE	100
#define MODBUS_TX_BUF_SIZE	500
#define MODBUS_REG_SIZE		20

#define MB_ADDR_PARAM_NUM       1
#define MB_ADDR_CTRL            2
#define MB_ADDR_PWM_IN          3


extern uint16_t modbusRegister[MODBUS_REG_SIZE];
extern int mbus_03_rx_count;


void modbus_poll(void);
void modbus_rx_callback(uint8_t data);
void modbus_timer_callback(void);
void modbus_03_request(uint16_t addr, uint16_t num);

#endif


